<template>
  <j-modal
    :title="title"
    :width="1200"
    :visible="visible"
    :maskClosable="false"
    switchFullscreen
    @ok="handleOk"
    :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
    @cancel="handleCancel">

    <research-zxkyxm-form v-if="projectType ==1" :project-type="projectType" :date="date" ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></research-zxkyxm-form>
    <research-hxkt-form v-if="projectType ==2" :project-type="projectType" :date="date" ref="realForm"
                        @ok="submitCallback" :disabled="disableSubmit"></research-hxkt-form>
    <research-xslw-form v-if="projectType ==3" :project-type="projectType" :date="date" ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></research-xslw-form>
    <research-lwhj-form v-if="projectType ==4" :project-type="projectType" :date="date" ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></research-lwhj-form>
    <research-zzjc-form v-if="projectType ==5" :project-type="projectType" :date="date" ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></research-zzjc-form>
    <research-kjcg-form v-else-if="projectType==6":project-type="projectType" :date="date" ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></research-kjcg-form>
    <research-fmzl-form v-else-if="projectType==7":project-type="projectType" :date="date" ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></research-fmzl-form>
    <research-yjbg-form v-else-if="projectType==8":project-type="projectType" :date="date" ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></research-yjbg-form>
    <research-dzbz-form v-else-if="projectType==9":project-type="projectType" :date="date" ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></research-dzbz-form>
  </j-modal>
</template>

<script>


import ResearchZxkyxmForm from '@views/gfxy/research/modules/ResearchZxkyxmForm'
import ResearchHxktForm from '@views/gfxy/research/modules/ResearchHxktForm'
import ResearchXslwForm from '@views/gfxy/research/modules/ResearchXslwForm'
import ResearchLwhjForm from '@views/gfxy/research/modules/ResearchLwhjForm'
import ResearchZzjcForm from '@views/gfxy/research/modules/ResearchZzjcForm'
import ResearchKjcgForm from '@views/gfxy/research/modules/ResearchKjcgForm'
import ResearchFmzlForm from '@views/gfxy/research/modules/ResearchFmzlForm'
import ResearchYjbgForm from '@views/gfxy/research/modules/ResearchYjbgForm'
import ResearchDzbzForm from '@views/gfxy/research/modules/ResearchDzbzForm'

export default {
  name: "ResearchCommonModal",
  props:['projectType','date'],
  components: {
    ResearchHxktForm,
    ResearchZxkyxmForm,
    ResearchXslwForm,
    ResearchLwhjForm,
    ResearchZzjcForm,
    ResearchDzbzForm,
    ResearchYjbgForm,
    ResearchFmzlForm,
    ResearchKjcgForm

  },
  data() {
    return {
      title:'',
      width:800,
      visible: false,
      disableSubmit: false
    }
  },
  created() {

  },
  methods:{
    add () {
      this.visible=true
      this.$nextTick(()=>{
        this.$refs.realForm.add();
      })
    },
    edit (record) {
      this.visible=true
      this.$nextTick(()=>{
        this.$refs.realForm.edit(record);
      })
    },
    close () {
      this.$emit('close');
      this.visible = false;
    },
    handleOk () {
      this.$refs.realForm.handleOk();
    },
    submitCallback(){
      this.$emit('ok');
      this.visible = false;
    },
    handleCancel () {
      this.close()
    }
  }
}
</script>

<style scoped>

</style>